package com.example.demo.controller;

import org.springframework.web.bind.annotation.*;

import java.util.Random;

@RestController
public class helloworldcontroller {
    @GetMapping("square/{number}")
    @ResponseBody
    public int square(@PathVariable int number){
        return number*number;
    }
    @RequestMapping("/random")
    @ResponseBody
    public int random(){
        Random random = new Random();
        int randomNumber = random.nextInt(1000);
        return randomNumber;
    }
}
